Skip to content

Claude/fix asset packing kzlcs#31

Merged
NerdsCorp merged 3 commits into
mainfrom
claude/fix-asset-packing-Kzlcs
Dec 28, 2025
Merged

Claude/fix asset packing kzlcs#31
NerdsCorp merged 3 commits into
mainfrom
claude/fix-asset-packing-Kzlcs

Conversation

@NerdsCorp

Copy link
Copy Markdown
Owner

No description provided.

… button positioning

- Modified packAssets method to scan all texture subdirectories in resources folder instead of relying on in-memory textures
- Added support for packing all texture folders: gui, paperdolls, resources, spells, tilesets, updater, faces, fonts, items, misc, animations, entities
- Added support for packing fonts folder (.xnb files) when present
- Added support for packing updater folder files when present
- Fixed UI button positioning in FrmUploadToServer by moving Login, Upload, and Close buttons up from Y=240 to Y=215 to prevent them from being cut off at the bottom of the form
- Improved asset collection to directly scan the rootDirectory parameter instead of using cached GameContentManager textures

This ensures all asset folders are properly packed regardless of what's currently loaded in the editor's memory.
…npacking them

The client loads fonts and updater .xnb files directly from the file system and doesn't have support for unpacking them from asset packs. Only sounds and music have AssetPacker support on the client side.

Changes:
- Removed fonts directory from texture scanning (contains only .xnb files, not PNGs)
- Kept updater directory in texture scanning (can contain PNG files like progressbar.png)
- Removed fonts.index packing code (not supported by client)
- Removed updater.index packing code (not supported by client)
- Added comments explaining why these directories are handled differently
- Textures (PNG files) are still packed from all appropriate folders including updater

This ensures only assets that the client can unpack are included in asset packs.
Fixed two critical issues with asset packing and uploading:

1. Asset Packing Path Format:
   - Changed texture paths to use relative format matching GameContentManager
   - Textures now use paths like "resources/items/sword.png" (relative to root)
   - This ensures .meta files contain correct paths for upload exclusion logic
   - Paths are normalized with forward slashes for cross-platform compatibility

2. Upload Exclusion Logic Fix:
   - Fixed texture exclusion to work with full relative paths in .meta files
   - Removed redundant Path.Combine that was creating incorrect double "resources/" prefix
   - Now correctly matches packed texture filenames like "resources/items/sword.png"
   - Exclusion logic now properly excludes source files when uploading packed assets

These changes ensure that when asset packing is enabled, only the packed .asset and .meta
files are uploaded, and the original source PNG/WAV/OGG files are correctly excluded.
@NerdsCorp NerdsCorp merged commit cfd0498 into main Dec 28, 2025
1 check passed
@NerdsCorp NerdsCorp deleted the claude/fix-asset-packing-Kzlcs branch December 28, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants